package com.cc.dao;

import com.cc.po.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 操作类型
 * Created by zcc on 2020/12/17.
 */
public interface TypeRepository extends JpaRepository<Type,Long> {

    Type findByName(String name);

//自定义查询语句
    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);
}
